home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Mag HDD Backup
/
Amiga Mag HDD Backup.zip
/
Amiga Mag HDD Backup
/
Alexander.img.bin
/
Alexander.img
/
tech 4.1 editorial Archive.sit
/
Nee
/
menu.i
< prev
next >
Wrap
Text File
|
1993-07-16
|
5KB
|
263 lines
;MENU.i
;menu equates
menupick equ $100
menuverify equ $2000
lowcommwidth equ $10
commwidth equ $1b
lowcheckwidth equ $0d
checkwidth equ $13
menuenabled equ $1
checkit equ $1
itemtext equ $2
commseq( equ $4
menutoggle equ $8
itemenabled equ $10
highimage equ $0
highcomp equ $40
highbox equ $80
highnone equ $c0
checked equ $100
nomenu equ $1f
noitem equ $3f
nosub equ $1f
menunull equ $ffff
selectdown equ $68
menudown equ $69
selectup equ $e8
menuup equ $e9
im.class equ $14
im.code equ $18
im.qualifier equ $1a
im.iaddress equ $1c
im.mousex equ $20
im.mousey equ $22
im.seconds equ $24
im.micros equ $28
im.idcmpwindow equ $2c
im.speciallink equ $30
;MACROS
openmenu macro ;<menu0>
lea \1,a1
movea.l window(pc),a0
intlib setmenustrip
endm
closemenu macro
movea.l window(pc),a0
intlib clearmenustrip
endm
cfm macro ;check_for_message <branch to if no message>
movea.l window(pc),a0
move.l #menunull,d0
intlib onmenu
movea.l window(pc),a0
movea.l ww.userport(a0),a0
syslib getmsg
tst.l d0
beq \1
movea.l d0,a1
move.l im.class(a1),d2 ;IDCMP flags
move.w im.code(a1),d3 ;menu #
move.w im.qualifier(a1),d4 ;rawkey code
movea.l im.iaddress(a1),a0 ;gadget address
move.w im.mousex(a1),d5 ;X coordinate
move.w im.mousey(a1),d6 ;Y coordinate
syslib replymsg
endm
eval_menunumber macro
moveq #0,d0
moveq #0,d1
moveq #0,d2
move.w d3,d0
move.w d3,d1
move.w d3,d2
andi.w #31,d0 ; = menu #
lsr.w #5,d1
andi.w #63,d1 ; = item #
rol.w #5,d2
andi.w #31,d2 ; = sub-item #
endm
makemenu macro ;<this menu,'Menu Title',next menu,left edge,enabled>
\1
ifnc '\3',''
dc.l \3
endc
ifc '\3',''
dc.l 0
endc
dc.w \4,0,90,0,\5
dc.l \1title
dc.l \1item0
dc.w 0,0,0,0
evenpc
\1title
dc.b \2,0
evenpc
endm
makeitem macro ;<this item,'Item Name',next item,top,$flags,$ME,
; 'Command Key',sub-item>
\1
ifnc '\3',''
dc.l \3
endc
ifc '\3',''
dc.l 0
endc
dc.w 0,\4,130+commwidth,10,\5
ifnc '\6',''
dc.l \6
endc
ifc '\6',''
dc.l 0
endc
dc.l \1itext,0
ifnc '\7',''
dc.b \7,0
endc
ifc '\7',''
dc.b 0,0
endc
ifnc '\8',''
dc.l \8
endc
ifc '\8',''
dc.l 0
endc
dc.w 0
evenpc
\1itext
dc.b 1,0,2,0
dc.w checkwidth,0
dc.l 0,\1name,0
evenpc
\1name dc.b \2,0
evenpc
endm
makesubitem macro ;<this subitem,'SubItemName',next subitem,top
; $flags,$ME,'CommandKey'>
\1
ifnc '\3',''
dc.l \3
endc
ifc '\3',''
dc.l 0
endc
dc.w 65,\4,130+commwidth,10,\5
ifnc '\6',''
dc.l \6
endc
ifc '\6',''
dc.l 0
endc
dc.l \1itext,0
ifnc '\7',''
dc.b \7,0
endc
ifc '\7',''
dc.b 0,0
endc
dc.l 0
dc.w 0
evenpc
\1itext
dc.b 1,0,2,0
dc.w checkwidth,0
dc.l 0,\1name,0
evenpc
\1name dc.b \2,0
evenpc
endm
;gadget equates
;flags
gadghcomp equ $0
gadghbox equ $1
gadghimage equ $2
gadghnone equ $3
gadgimage equ $4
grelbottom equ $8
grelright equ $10
grelwidth equ $20
grelheight equ $40
selected equ $80
gadgdisabled equ $100
;activation
relverify equ $1 ;IDCMP => GADGETUP
gadgimmediate equ $2 ;IDCMP => GADGETDOWN
endgadget equ $4
followmouse equ $8
rightborder equ $10
leftborder equ $20
topborder equ $40
bottomborder equ $80
toggleselect equ $100
stringcenter equ $200
stringright equ $400
longint equ $800
altkeymap equ $1000
boolextend equ $2000
;types
boolgadget equ $1
propgadget equ $3
strgadget equ $4
reqgadget equ $1000
gzzgadget equ $2000
makestrgadget macro ;<this gadget,'GadgetName',next gadget,left edge,
; top edge,width,height,$flags,$activation,$ME,
; ID#,max characters>
\1
ifnc '\3',''
dc.l \3
endc
ifc '\3',''
dc.l 0
endc
dc.w \4,\5,\6,\7,\8,\9,4
dc.l \1border,0,\1itext,\10,\1info
dc.w \11
dc.l 0
evenpc
\1info
dc.l \1buffer,\1undobuffer
dc.w 0,\12,0,0,0,0,0,0
dc.l 0,0,0
evenpc
;\1buffer ds.b \12+1
; evenpc
\1undobuffer ds.b \12+1
evenpc
\1border
dc.w -2,-2
dc.b 1,0,0,5
dc.l \1points,0
evenpc
\1points
dc.w 0,0,\6+4,0,\6+4,\7+4,0,\7+4,0,0
evenpc
\1itext
dc.b 3,0,1,0
dc.w 0,-11
dc.l 0,\1name,0
evenpc
\1name
dc.b \2,0
evenpc
endm
removegadgets macro
movea.l window(pc),a0
move.l #0,62(a0)
endm